import org.junit.Test;

import java.util.Arrays;
import java.util.Comparator;
import java.util.Date;
import java.util.Random;

import static org.junit.Assert.assertEquals;

public class Compare {
    @Test
    public void test1() {

        Integer[] ints = {42, 423, 65, 123423, 75, 3234, 74, 234, 132, 44, 13};
//        Arrays.sort(ints, Collections.reverseOrder());
        Arrays.sort(ints, Comparator.comparingInt(Integer::intValue).reversed());
//        Arrays.sort(ints, Collections.reverseOrder(Comparator.comparingInt(Integer::intValue)).reversed());
//        Arrays.sort(ints, Integer::compare);
        System.out.println(Arrays.toString(ints));
    }

    @Test
    public void test2() {
//        System.err.println("你看到见我吗？");
//        System.getProperties().list(System.out);
//        Math.random();

        Random random = new Random();
        random.setSeed(System.currentTimeMillis());
        int i = random.nextInt(1999);
        System.out.println(i);
    }

    @Test
    public void test3() {
        long timeStamp = System.currentTimeMillis();
        assertEquals(timeStamp, new Date().getTime());
    }

    @Test
    public void test4() {
        String pre = "123";
        String post = "456";
        String result = pre + post;
        System.out.println(result);
        String substring = result.substring(2).intern();
        System.out.println(substring);
    }
}